﻿@{
    ViewBag.Title = "Home Page";
}

<script type="text/javascript">

    $(document).ready(function () {

        $("#first").ready(function () {
            $.get('Sessionless/FirstWindow', function (data) {
                $('#first').html(data);
            });
        });



        $("#third").ready(function () {
            $.get('Sessionless/ThirdWindow', function (data) {
                $('#third').html(data);
            });
        });

        @for (int i = 0; i < 4; i++) {
            string ac;
        if (i % 2 == 0)
        {
            ac = "FirstWindow";
        }
        else 
        {
            ac = "FirstWindow";
        }

        <text>
            
		$("#id@(i)").ready(function () {
            $.get('Sessionless/@(ac)', function (data) {
                $('#id'+@(i)).html(data);
                });
        });
        </text>
		}

//        $("#second").ready(function () {
//            $.get('Sessionless/SecondWindow', function (data) {
//                $('#second').html(data);
//            });
//        });
        
        $("#button").click(function () {
            $.get('Sessionless/Unlock', function (data) {
                alert('poszedl unlock');
            });
        });
    }
    );

</script>

<h2>@ViewBag.Message</h2>
<p>
    Ajax calls
</p>

<div id="first" class="first" >

</div>

<div id="second" class="second">

</div>

<div id="third" class="third">

</div>

@for (int i = 0; i < 4; i++) {
<div id="id@(i)" class="third">

</div>
}

<div id="button" class="first">Click</div>